home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12433 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: sprintf() question
  5. Date: Sat, 30 Mar 96 21:08:21 GMT
  6. Organization: none
  7. Message-ID: <828220101snz@genesis.demon.co.uk>
  8. References: <31593522.76B3@cbm.com> <315C8C98.7FA7@olympic.net>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <315C8C98.7FA7@olympic.net>
  15.            eanders@olympic.net "Erik W. Anderson" writes:
  16.  
  17. >Maybe this is changing your question but if you're just working with
  18. >strings, why not use "strcpy" & "strcat"?
  19.  
  20. Because they also invoke undefined behaviour when copying between
  21. overlapping objects. The answer is to use an extra buffer to ensure that
  22. the source and destination objects are distinct.
  23.  
  24. -- 
  25. -----------------------------------------
  26. Lawrence Kirby | fred@genesis.demon.co.uk
  27. Wilts, England | 70734.126@compuserve.com
  28. -----------------------------------------
  29.